import { BaseModifier, registerModifier } from '../../utils/dota_ts_adapter';

@registerModifier()
class modifier_out_of_world extends BaseModifier {
    serverside: boolean = true;
    CheckState(): Partial<Record<ModifierState, boolean>> {
        return {
            [ModifierState.OUT_OF_GAME]: this.serverside,
            [ModifierState.PROVIDES_VISION]: false,
            [ModifierState.PASSIVES_DISABLED]: true,
            [ModifierState.NO_UNIT_COLLISION]: true,
            [ModifierState.NOT_ON_MINIMAP]: true,
            [ModifierState.NO_HEALTH_BAR]: true,
            [ModifierState.UNSELECTABLE]: true,
            [ModifierState.INVULNERABLE]: true,
            [ModifierState.NO_TEAM_MOVE_TO]: true,
            [ModifierState.NO_TEAM_SELECT]: true,
            [ModifierState.STUNNED]: true,
            [ModifierState.BLIND]: true,
            [ModifierState.COMMAND_RESTRICTED]: true,
        };
    }

    OnCreated(params: object): void {
        const unit = this.GetParent();
        this.serverside = params['clientside'] != 1;
    }

    IsPurgable() {
        return false;
    }
}
